package com.wazzapps.sdk;

import android.content.Context;

import com.wazzapps.sdk.utils.CertificateSHA1Fingerprint;

public class WazzChecker {
    private static final String[] ALLOWED_SHA = {"cf4955b43064034b9ac5b7efb85054ed6910b5a4", "30FAFC5F84FFA1215811FDA92315DF29BDDAED47", "7796DD0E101A0D83DB359C06C7960486528596EB", "33822B2D1DD01CB5382755752B7DA2F28EEFDA10", "AF111C4BC8D06C495A74F19A7DBA242E19D41B2A", "847F3EB5B79316038899B07A76F4C338AE71EF4A", "3595F4453672F5F673AAA57AE76B9ECB629040B8", "CCB4FAE7FBEE1CCD3A6E2855F7C209B88F828D22", "10D4F077E2C65F652A186BDF73BB50D39301FB68"};

    public static boolean isWrongAppSignature(Context context) {
        if (context.getPackageName().contains("amazon")) {
            return false;
        }
        String lowerCase = CertificateSHA1Fingerprint.getCertificateSHA1Fingerprint(context).toLowerCase();
        for (String str : ALLOWED_SHA) {
            if (str.toLowerCase().equals(lowerCase)) {
                return false;
            }
        }
        return true;
    }
}